package com.aaa.sbm.controller;

import com.aaa.sbm.common.ResultUtil;
import com.aaa.sbm.entity.User;
import com.aaa.sbm.service.MenuService;
import com.aaa.sbm.util.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * @FileName: MenuController
 * @Description:
 * @Author: 王成林
 * @CreateTime: 2025/7/8 20:23
 * @Version: 1.0.0
 */
@RestController
@RequestMapping("menu")
public class MenuController {
    @Resource
   private MenuService menuService;
    @Resource
    private HttpSession session;

   @GetMapping("queryTreeDateByUserId")
   public Result queryTreeDateByUserId(HttpSession  session){
     User  user = (User)session.getAttribute("userinfo");
    return ResultUtil.success(menuService.queryTreeDateByUserId(user.getUser_id()));
   }

}
